Skip to content

fix: package compiles again on Unity 6000.4 and newer#1735

Merged
hatayama merged 1 commit into
mainfrom
fix/issue-1732
Jul 13, 2026
Merged

fix: package compiles again on Unity 6000.4 and newer#1735
hatayama merged 1 commit into
mainfrom
fix/issue-1732

Conversation

@hatayama

@hatayama hatayama commented Jul 13, 2026

Copy link
Copy Markdown
Owner

Summary

  • Installing the package on Unity 6000.4+ no longer fails with a CS0619 compile error.

User Impact

  • Before: on Unity 6000.4+ (e.g. 6000.5.3f1), the package failed to compile with error CS0619: 'Object.GetInstanceID()' is obsolete at RaycastGridAnnotator.cs:376, so git-URL installs from main were broken.
  • After: the package compiles cleanly on Unity 6000.4+ while keeping identical behavior on older Unity versions.

Changes

Verification

  • Red: batch-compiled a scratch project referencing this package on Unity 6000.5.0f1 without the fix → reproduced the exact CS0619 at RaycastGridAnnotator.cs:376.
  • Green: same batch compile with the fix on Unity 6000.5.0f1 → 0 errors.
  • Boundary/legacy: batch compile on Unity 6000.4.3f1 and 2022.3.62f3 → 0 errors on both.

Fixes #1732

Review in cubic

Summary

Updated RaycastGridAnnotator for Unity 6000.4+ compatibility by deriving cluster keys from the lower 32 bits of EntityId. Older Unity versions continue using GetInstanceID().

Verification

  • Unity 6000.5.0f1: compilation errors resolved
  • Unity 6000.4.3f1: zero errors
  • Unity 2022.3.62f3: zero errors

Fixes #1732.

…6000.4+

Object.GetInstanceID() is obsolete-as-error (CS0619) starting Unity
6000.4, so the package failed to compile on Unity 6000.4+ git installs.
The #1118 fix guarded ComponentPropertySerializer and HierarchyService
but missed this call site. Apply the same UNITY_6000_4_OR_NEWER guard;
the lower 32 bits of EntityId equal the legacy instance id, which keeps
the cluster key semantics unchanged.

Fixes #1732
@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 5233837b-3238-4dc0-b88d-f8c1a601439f

📥 Commits

Reviewing files that changed from the base of the PR and between b4db894 and cdfcc7c.

📒 Files selected for processing (1)
  • Packages/src/Editor/Utils/RaycastGridAnnotator.cs

📝 Walkthrough

Walkthrough

RaycastGridAnnotator.CreateClusterKey now uses EntityId for Unity 6000.4+ and preserves GetInstanceID() for older Unity versions.

Changes

Raycast cluster key compatibility

Layer / File(s) Summary
Conditional cluster-key generation
Packages/src/Editor/Utils/RaycastGridAnnotator.cs
CreateClusterKey derives keys from the lower 32 bits of EntityId on Unity 6000.4+ and uses GetInstanceID() on older versions.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main fix: restoring compilation on Unity 6000.4+.
Linked Issues check ✅ Passed The change matches #1732 by replacing GetInstanceID() with the Unity 6000.4+ EntityId path while preserving older versions.
Out of Scope Changes check ✅ Passed The PR only updates RaycastGridAnnotator.cs for the reported compile issue and adds no unrelated changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/issue-1732

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@hatayama hatayama merged commit 61a0fe6 into main Jul 13, 2026
9 checks passed
@hatayama hatayama deleted the fix/issue-1732 branch July 13, 2026 03:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CS0619: Object.GetInstanceID() obsolete error in RaycastGridAnnotator.cs on Unity 6000.4+ (follow-up to #1118)

1 participant